package top.codecrab.eblog;

import cn.hutool.core.util.StrUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import top.codecrab.eblog.config.Constants;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
public class EblogApplication {

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        SpringApplication.run(EblogApplication.class, args);
        System.out.println(StrUtil.format("Service startup in {} ms, Host：{}", (System.currentTimeMillis() - start), Constants.EBLOG_HOST));
    }

    @PostConstruct
    void started() {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
    }
}
